Add JSpecify nullable annotations to exception classes #16027
Closed
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
🔗 Related Issues
partially fixes #14291
💥 What does this PR do?
same as
#16024
#16025
#16026
🔧 Implementation Notes
This pull request introduces updates to several exception classes across the Selenium codebase to improve null-safety and enhance clarity. The changes primarily involve adding
@NullMarked
annotations to the classes and@Nullable
annotations to method parameters where applicable.Null-safety improvements:
java/src/org/openqa/selenium/devtools/RequestFailedException.java
: Added@NullMarked
annotation to the class to enforce null-safety.java/src/org/openqa/selenium/grid/sessionmap/jdbc/JdbcException.java
: Added@NullMarked
annotation to the class and@Nullable
annotations to method parameters (message
andcause
) to handle potential null values.java/src/org/openqa/selenium/remote/NoSuchDriverException.java
: Added@NullMarked
annotation to the class and updated constructors to include@Nullable
annotations forreason
andcause
parameters.java/src/org/openqa/selenium/remote/UnreachableBrowserException.java
: Added@NullMarked
annotation to the class and updated constructors with@Nullable
annotations formessage
andcause
parameters.java/src/org/openqa/selenium/support/ui/UnexpectedTagNameException.java
: Added@NullMarked
annotation to the class and updated the constructor to include@Nullable
annotations forexpectedTagName
andactualTagName
parameters.💡 Additional Considerations
🔄 Types of changes